% str = cell2str (tokens,pad)
% Function to convert a cell of string into a single string separated by a
% padding string

% Salil Deena
% 05/03/10

function str = cell2str (tokens, varargin)
    if length(varargin) > 0
        pad = varargin{1};
    else
        pad = '';
    end
    
    str = '';
    for i = 1:length(tokens)
        str = [str tokens{i} pad];
    end
    
    if length(pad) > 0
        str = str(1:end-length(pad));
    end
end